package com.glsc.ngateway.common.base.domain.mysql.gateway.platform.flow;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

@Entity
@Data
@Table(name = "t_gw_flow_form_event_detail_improve")
public class FlowFormEventDetailImprove implements Serializable {

    @ApiModelProperty(value = "整改措施ID")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "improve_id", columnDefinition = "int comment '唯一编号'")
    private Integer improveId;

    @ApiModelProperty(value = "流程ID")
    @Column(name = "process_id", columnDefinition = "varchar(60) comment '关联事件流程id'")
    private String processId;

    @ApiModelProperty(value = "是否删除标记，0未删除，1删除")
    @Column(name = "be_deleted", columnDefinition = "int comment '是否删除标记，0未删除，1删除'")
    private Integer beDeleted = 0;

    /**
     * 整改标题
     */
    @ApiModelProperty(value = "整改标题")
    @Column(name = "improve_title", columnDefinition = "varchar(200) comment '整改标题'")
    String improveTitle;


    /**
     * 整改内容
     */
    @ApiModelProperty(value = "整改内容")
    @Column(name = "improve_content", columnDefinition = "text comment '整改内容'")
    String improveContent;

    /**
     * 整改负责人账号
     */
    @ApiModelProperty(value = "整改负责人账号")
    @Column(name = "improve_person_list", columnDefinition = "varchar(100) comment '整改负责人账号多个，号分隔'")
    String improvePersonList;

    /**
     * 整改负责人姓名
     */
    @ApiModelProperty(value = "整改负责人姓名")
    @Column(name = "improve_person_name_list", columnDefinition = "varchar(100) comment '整改负责人姓名多个，号分隔'")
    String improvePersonNameList;


    @ApiModelProperty(value = "计划完成时间")
    @Column(name = "plan_date", columnDefinition = "datetime comment '计划完成时间'")
    protected String planDate;

    @ApiModelProperty(value = "实际完成时间")
    @Column(name = "finish_date", columnDefinition = "datetime comment '实际完成时间'")
    protected String finishDate;

    /**
     * 顺序号
     */
    @Column(name = "sort_no", columnDefinition = "int(10) comment '顺序号'")
    private Integer sortNo;

    /**
     * 整改流程id
     */
    //事件流程会触发整改流程，这个字段保存这个关系
    @ApiModelProperty(value = "事件整改措施触发整改流程ID")
    @Column(name = "improve_process_id", columnDefinition = "varchar(60) comment '整改措施触发的整改流程id'")
    private String improveProcessId;

    /**
     * 整改状态
     */
    @ApiModelProperty(value = "整改状态 字典")
    @Column(name = "improve_state", columnDefinition = "varchar(10) comment '录入后为待确认状态，负责人确认改为执行，团队负责人确认改成完成。" +
            "或为取消状态'")
    private String improveState;

    @Column(name = "insert_time", columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @Column(name = "update_time", columnDefinition = "datetime comment '更新时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;




}
